package noahzu.github.io.baselib.utils.fragmentMaker;


import android.os.Bundle;
import android.support.v4.app.Fragment;

/**
 * Created by gejinpeng on 2017/9/28.
 */

public final class FragmentSpec {
    public Class fragmentClass;
    public Bundle arguments;
    public Fragment fragment;

    public boolean mIsShowTitleView;
    public boolean mIsTitleViewBackFinish;
    public String mTitle;

    private FragmentSpec() {
    }

    public static FragmentSpec getInstance() {
        return FragmentSpec.InstanceHolder.INSTANCE;
    }

    public static FragmentSpec getCleanInstance() {
        FragmentSpec spec = getInstance();
        spec.reset();
        return spec;
    }

    private void reset() {
        fragment = null;
        arguments = null;
        fragmentClass = null;
    }

    private static final class InstanceHolder {
        private static final FragmentSpec INSTANCE = new FragmentSpec();

        private InstanceHolder() {
        }
    }

}
